﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ContactList.ascx.cs" Inherits="MockPrjTeam4.ContactList" %>
<%@ Import Namespace="MockPrjTeam4.Entity" %>  
<script type="text/javascript">
    function deleteAlert() {
    {
        var r=confirm("Do you want to delete?");
        if (r==true)
        {
          x="You pressed OK!";
        }
        else
        {
          x="You pressed Cancel!";
        }
    }
</script> 
<style type="text/css">
    .isActive
    {
        text-align: center;
        }
    .cssPaper
    {
        }
    .lbl
    {
        margin-left: 50px;
        margin-top: 50px;
        font-size: larger;
    }
    .txt
    {
        
    }
    .res
    {
        text-align:justify;
        font-size: larger;
        }
    .style4
    {
        width: 346px;
        height: 54px;
    }
    .style5
    {
        height: 54px;
    }
    .style6
    {
        height: 41px;
    }
    .style7
    {
        height: 43px;
    }
    .wrap
    {
        border: 1px solid #330099;
        margin-left: 50px;
        width: 900px;
        }
        .search
        {
            border-bottom: 1px solid #330099;
            }
    .tblSearch
    {
        margin-left: 50px;
        }
    .tblGV
    {
        margin-left: 50px;
        }
</style>
<div class="wrap">
    <div class="search">
        <table border="0" cellspacing="0" cellpadding="0" width="89%" class="tblSearch">
        	<tr>
            <td class="style5">First Name: </td>
            <td class="style4">
                <asp:TextBox ID="txtFirstName" runat="Server" Width="196px"></asp:TextBox>
            </td>
            <td class="style5">Surname: </td>
            <td class="style5">
                <asp:TextBox ID="txtSurname" runat="Server" Width="221px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td colspan="2" class="style7">
                <asp:Button ID="btnSearch" runat="Server" Text="Search Contact" 
                    onclick="btnSearch_Click"/>&nbsp
                <asp:Button ID="btnClear" runat="Server" Text="Clear" onclick="btnClear_Click"/>&nbsp
                <asp:Button ID="btnCreate" runat="Server" Text="Create" 
                    onclick="btnCreate_Click"/>&nbsp
            </td>
            <td colspan="2">
                <asp:CheckBox ID="chkInactive" runat="Server" Text="Include in-active contact?" 
                    oncheckedchanged="chkInactive_CheckedChanged" AutoPostBack="true"/>
                <asp:HiddenField ID="hdfFilter" runat="Server"/>
            </td>
        </tr>
        </table>
    </div>
    <table border="0" cellspacing="2px" cellpadding="4px" 
        style="height: 263px; width: 89%;" class="tblGV">
        <tr>
            <td>
                <asp:LinkButton ID="lkbtnAll" runat="server" Text="All" ForeColor="Blue"
                            CommandName="SearchAll" OnCommand="Click"></asp:LinkButton>&nbsp|&nbsp
                            <asp:LinkButton ID="lkbtn09" runat="server" Text="0 - 9" ForeColor="Blue"
                            CommandName="Search09" OnCommand="Click"></asp:LinkButton>&nbsp|&nbsp
                            <asp:LinkButton ID="lkbtnAE" runat="server" Text="A B C D E" ForeColor="Blue"
                            CommandName="SearchAE" OnCommand="Click"></asp:LinkButton>&nbsp|&nbsp
                            <asp:LinkButton ID="lkbtnFJ" runat="server" Text="F G H I J" ForeColor="Blue"
                            CommandName="SearchFJ" OnCommand="Click"></asp:LinkButton>&nbsp|&nbsp
                            <asp:LinkButton ID="lkbtnKN" runat="server" Text="K L M N" ForeColor="Blue"
                            CommandName="SearchKN" OnCommand="Click"></asp:LinkButton>&nbsp|&nbsp
                            <asp:LinkButton ID="lkbtnOR" runat="server" Text="O P Q R" ForeColor="Blue"
                            CommandName="SearchOR" OnCommand="Click"></asp:LinkButton>&nbsp|&nbsp
                            <asp:LinkButton ID="lkbtnSV" runat="server" Text="S T U V" ForeColor="Blue"
                            CommandName="SearchSV" OnCommand="Click"></asp:LinkButton>&nbsp|&nbsp
                            <asp:LinkButton ID="lkbtnWZ" runat="server" Text="W X Y Z" ForeColor="Blue"
                            CommandName="SearchWZ" OnCommand="Click"></asp:LinkButton>
            </td>
        </tr>
        <tr>
            <td colspan="4" align="center">
                <asp:Label ID="lblMessageResult" runat="Server" ForeColor="Red" Font-Bold="true" CssClass="res"></asp:Label>
                <asp:GridView ID="gvListContact" runat="Server" AllowPaging="true"
                 AutoGenerateColumns="False" AllowSorting="True"
                    Width="100%" style="margin-top: 3px" BackColor="White" 
                    BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px" CellPadding="4"
                    DataKeyNames="ContactId" PageSize="15" OnPageIndexChanging="gvListContact_PageIndexChanging">
                    <PagerStyle CssClass="cssPaper"/>
                    <Columns>                        
                        <asp:HyperLinkField ControlStyle-ForeColor="Blue" ShowHeader="True" DataTextField="FirstName"
                        HeaderText="FirstName" DataNavigateUrlFields="ContactId" 
                            DataNavigateUrlFormatString="/Pages/Forms/EditContact.aspx?ID={0}">
<ControlStyle ForeColor="Blue"></ControlStyle>
                        </asp:HyperLinkField>
                        <asp:BoundField DataField="Surname" HeaderText="Surname" ReadOnly="true" SortExpression="Surname"/>
                        <asp:BoundField DataField="MobilePhone" HeaderText="MobilePhone" ReadOnly="true" SortExpression="MobilePhone"/>
                        <asp:BoundField DataField="Email" HeaderText="Email" ReadOnly="true" SortExpression="Email"/>
                        <asp:BoundField DataField="IsActive" HeaderText="IsActive" ReadOnly="true" 
                        SortExpression="IsActive" ItemStyle-CssClass="isActive"/>

                    </Columns>
                    <FooterStyle BackColor="#FFFFCC" ForeColor="#330099"/>
                    <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" />
                    <PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
                    <RowStyle BackColor="White" ForeColor="#330099" />
                    <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
                    <SortedAscendingCellStyle BackColor="#FEFCEB" />
                    <SortedAscendingHeaderStyle BackColor="#AF0101" />
                    <SortedDescendingCellStyle BackColor="#F6F0C0" />
                    <SortedDescendingHeaderStyle BackColor="#7E0000" />
                </asp:GridView>
            </td>
        </tr>

        <tr>
            <td colspan="2">
                <asp:Button ID="btnDelete" runat="Server" Text="Delete" onclick="btnDelete_Click"
                OnClientClick="return confirm('Do you want to delete?');" CommandName="Delete"/>&nbsp
            </td>
        </tr>
    </table>
</div>
<div class="lbl">
    <asp:Label  ID="lblMessage" runat="Server" ForeColor="red" ></asp:Label>
</div>
